#include <cv.h>
#include <ml.h>
using namespace cv;

int main(int argc, char **argv) {

	int sampleCountForTesting = 2731; //BROKEN: Breaks for values of 2731 or greater!
	Mat trainingData( sampleCountForTesting, 1, CV_32FC1, Scalar::all(0.0) );
	Mat trainingResponses( sampleCountForTesting, 1, CV_32FC1, Scalar::all(0.0) );
	
	for(int j = 0; j < 6; j++) {
		trainingData.at<float>( j, 0 ) = (float) (j%2);
		trainingResponses.at<float>( j, 0 ) = (float) (j%2);
	} //Setting some values to avoid getting "single class" error during cross-validation step
	
	CvSVMParams svmParams( 100, //100 is CvSVM::C_SVC,
						  2, //2 is CvSVM::RBF,
						  1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
						  NULL,
						  TermCriteria( TermCriteria::MAX_ITER | TermCriteria::EPS, 2, 1.0 ) );
	CvSVM svm = CvSVM();
	svm.train_auto( trainingData, trainingResponses, Mat(), Mat(), svmParams );
	
	return 0;
}









